#include <iostream>

using namespace std;

int total(int cal[], int time)
{
	int i = 0, res = 0;
	
	while(i++ < time)
	{
		res += cal[i];
	//	cout << "---" << **cal << "---" << endl;
	}
	
	return res;
}

int main()
{
	int cal[3][12] {0};
	int res[3];
	int i = 0, j = 0;
	const char *moth[] {
		"January",
		"February",
		"March",
		"April",
		"May",
		"June",
		"July",
		"August",
		"Septempber",
		"October",
		"November",
		"December", 
	};
	
	for(i = 0; i < 3; i++)
	{
		cout << "Enter the " << i + 1 << " year's:" << endl;
		for(j = 0; j < 12; j++)
		{
			cout << "Enter the " << moth[j] << "'s number: ";
			(cin >> cal[i][j]).get();
		}
	}
	
	for(i = 0; i < 3; i++)
	{
		res[i] = total(cal[i], 12);
		cout << "The " << i << "year's sold is: " << res[i] << endl;  
	}
	
	cout << "The total number of sold book is: " << total(res, 3) << endl;
	
	return 0;
}
